
export default function request (param) {
  const { url, method, data } = param
  return new Promise((resolve, reject) => {
    wx.request({ url, method, data, header: { 'content-type': 'application/json' },
      success: res => {
        if(res.data) {
          resolve(res)
        } else {
          reject(res)
        }
      },
      fail: err => {
        reject(err)
      }
    })
  })
}